import 'package:flutter/material.dart';
import './blueItem.dart';
import './itemdata.dart';

void main() => runApp(App());

class App extends StatefulWidget {
  @override
  _AppState createState() => _AppState();
}

class _AppState extends State<App> {
  var _currentIndex = 1;

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.white,
          leading: Padding(
            padding: const EdgeInsets.all(4.0),
            child: IconButton(
              onPressed: () {},
              icon: Icon(
                Icons.menu,
                color: Colors.black,
              ),
            ),
          ),
          title: Text(
            "Algebra 2",
            style: TextStyle(
                fontSize: 24.0, color: Color.fromRGBO(35, 84, 189, 1)),
          ),
          actions: <Widget>[
            Padding(
              padding: const EdgeInsets.all(4.0),
              child: IconButton(
                onPressed: () {},
                icon: Icon(
                  Icons.assignment_ind,
                  color: Color.fromRGBO(89, 89, 89, 1),
                ),
              ),
            ),
            Padding(
                padding: const EdgeInsets.only(top: 4.0, bottom: 4.0),
                child: IconButton(
                  onPressed: () {},
                  icon: Icon(
                    Icons.more_vert,
                    color: Color.fromRGBO(89, 89, 89, 1),
                  ),
                )),
          ],
        ),
        bottomNavigationBar: BottomNavigationBar(
          type: BottomNavigationBarType.fixed,
          currentIndex: _currentIndex,
          onTap: ((index) {
            setState(() {
              _currentIndex = index;
            });
          }),
          items: [
            new BottomNavigationBarItem(
                icon: Icon(
                  Icons.question_answer,
                  size: 32.0,
                  color:_currentIndex==0?Colors.blueAccent:Colors.grey,
                ),title: Text('Stream',style: TextStyle(color:_currentIndex==0?Color.fromRGBO(35, 84, 189, 1):Colors.grey,),)),
            new BottomNavigationBarItem(
                icon: Icon(
                  Icons.assignment,
                  size: 32.0,
                  color:_currentIndex==1?Colors.blueAccent:Colors.grey,
                ),title: Text('Classword',style: TextStyle(color:_currentIndex==1?Color.fromRGBO(35, 84, 189, 1):Colors.grey,),)),
            new BottomNavigationBarItem(
                icon: Icon(
                  Icons.people,
                  size: 32.0,
                  color:_currentIndex==2?Colors.blueAccent:Colors.grey,
                ),title: Text('People',style: TextStyle(color:_currentIndex==2?Color.fromRGBO(35, 84, 189, 1):Colors.grey,),)),
          ],
        ),
        body:Container(
          color: Colors.white,
          child:ListView(
          children: <Widget>[
            Container(
              padding: const EdgeInsets.only(left: 16.0,top: 32.0,right: 16.0,bottom: 16.0),
              child: BlueItem(itemdata1),
            ),
            Container(
              padding: const EdgeInsets.only(left: 16.0,top: 16.0,right: 16.0,bottom: 32.0),
              child: BlueItem(itemdata2),
            ),
            Container(margin: const EdgeInsets.all(16.0),padding: const EdgeInsets.only(bottom: 24.0),
              decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Color.fromRGBO(35, 84, 189, 1)))),
            child: Text('Graphing',style: TextStyle(
              fontSize: 30.0,color: Color.fromRGBO(35, 84, 189, 1)
            )),
            ), Container(
        padding: const EdgeInsets.only(left: 16.0,top: 8.0,right: 16.0,bottom: 16.0),
        child: BlueItem(itemdata3),),
            Container(
              padding: const EdgeInsets.only(left: 16.0,top: 16.0,right: 16.0,bottom: 16.0),
              child: BlueItem(itemdata4),),
            Container(margin: const EdgeInsets.all(16.0),padding: const EdgeInsets.only(bottom: 24.0),
              decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Color.fromRGBO(35, 84, 189, 1)))),
              child: Text('Videos',style: TextStyle(
                  fontSize: 30.0,color: Color.fromRGBO(35, 84, 189, 1)
              )),
            ),
            Container(
              padding: const EdgeInsets.only(left: 16.0,top: 16.0,right: 16.0,bottom: 16.0),
              child: BlueItem(itemdata5),),
          ],
        ),)

      ),
    );
  }
}


